Recurrence and (Inferred) Maximum Magnitude Examples

The objective of this example is to demonstrate how to use the catalogue tools to calculated recurrence by different methodologies


In [1]:
# Import required modules
import numpy as np
import matplotlib.pyplot as plt

from hmtk.parsers.catalogue.csv_catalogue_parser import CsvCatalogueParser, CsvCatalogueWriter

# Import Recurrence Tools
from hmtk.seismicity.occurrence.b_maximum_likelihood import BMaxLikelihood
from hmtk.seismicity.occurrence.kijko_smit import KijkoSmit
from hmtk.seismicity.occurrence.weichert import Weichert

# Import Mmax Tools
from hmtk.seismicity.max_magnitude.kijko_nonparametric_gaussian import KijkoNonParametricGaussian
from hmtk.seismicity.max_magnitude.kijko_sellevol_bayes import KijkoSellevolBayes
from hmtk.seismicity.max_magnitude.kijko_sellevol_fixed_b import KijkoSellevolFixedb
from hmtk.seismicity.max_magnitude.cumulative_moment_release import CumulativeMoment

print 'Import OK!'


Import OK!

In the present example we use a synthetic catalogue with known b-value properties and completeness windows


In [3]:
input_file = '../../hmtk/tests/seismicity/completeness/data/completeness_test_cat.csv'

parser = CsvCatalogueParser(input_file)
catalogue = parser.read_file()
print 'Input complete: %s events in catalogue' % catalogue.get_number_events()
print 'Catalogue Covers the Period: %s to %s' % (catalogue.start_year, catalogue.end_year)

# Plot magnitude time density
from hmtk.plotting.seismicity.catalogue_plots import plot_magnitude_time_density
magnitude_bin = 0.1
time_bin = 1.0
plot_magnitude_time_density(catalogue, 0.1, 1.0)


Catalogue Attribute sigmamb is not a recognised catalogue key
Catalogue Attribute sigmaMs is not a recognised catalogue key
Catalogue Attribute Ms is not a recognised catalogue key
Catalogue Attribute Identifier is not a recognised catalogue key
Catalogue Attribute mb is not a recognised catalogue key
Catalogue Attribute ML is not a recognised catalogue key
Catalogue Attribute sigmaML is not a recognised catalogue key
Input complete: 1801 events in catalogue
Catalogue Covers the Period: 1910 to 2009

In [4]:
# Known completeness properties
completeness = np.array([[1990., 4.0],
                         [1960., 4.5],
                         [1910., 5.5]])
from hmtk.plotting.seismicity.catalogue_plots import (plot_observed_recurrence, 
                                                      get_completeness_adjusted_table,
                                                      _get_catalogue_bin_limits)

earthquake_count = get_completeness_adjusted_table(catalogue, completeness, 0.1, 2009)
print 'Magnitude  N(OBS)     N(CUM)   Log10(Nc)'
for row in earthquake_count:
    print '%6.2f %10.3f %10.3f %10.3f' %(row[0], row[1], row[2], row[3]) 

plot_observed_recurrence(catalogue, completeness, 0.1)


Magnitude  N(OBS)     N(CUM)   Log10(Nc)
  4.00      6.300     49.400      1.694
  4.10      9.850     43.100      1.634
  4.20     13.250     33.250      1.522
  4.30      0.000     20.000      1.301
  4.40      0.000     20.000      1.301
  4.50      7.860     20.000      1.301
  4.60      2.560     12.140      1.084
  4.70      2.260      9.580      0.981
  4.80      0.000      7.320      0.865
  4.90      2.940      7.320      0.865
  5.00      0.860      4.380      0.641
  5.10      0.780      3.520      0.547
  5.20      0.600      2.740      0.438
  5.30      0.600      2.140      0.330
  5.40      0.000      1.540      0.188
  5.50      0.340      1.540      0.188
  5.60      0.140      1.200      0.079
  5.70      0.230      1.060      0.025
  5.80      0.180      0.830     -0.081
  5.90      0.150      0.650     -0.187
  6.00      0.120      0.500     -0.301
  6.10      0.040      0.380     -0.420
  6.20      0.120      0.340     -0.469
  6.30      0.060      0.220     -0.658
  6.40      0.040      0.160     -0.796
  6.50      0.040      0.120     -0.921
  6.60      0.000      0.080     -1.097
  6.70      0.010      0.080     -1.097
  6.80      0.010      0.070     -1.155
  6.90      0.030      0.060     -1.222
  7.00      0.000      0.030     -1.523
  7.10      0.010      0.030     -1.523
  7.20      0.000      0.020     -1.699
  7.30      0.020      0.020     -1.699

Recurrence Methods 1: b-Maximum Likelihood

The first method is simply an adaptation of the Aki (1965) approach in which b-value is determined from the weighted mean of the b-value for each completeness period.


In [5]:
# Set up the configuration parameters
recurrence_config = {'reference_magnitude': None,
                     'magnitude_interval': 0.1,
                     'Average Type': 'Weighted'}

bml_recurrence = BMaxLikelihood()

bval, sigmab, rate, sigma_rate = bml_recurrence.calculate(catalogue, recurrence_config, completeness)

print 'B-value = %9.4f +/- %9.4f' %(bval, sigmab)
print 'Rate (M >= 4.0) = %9.4f +/- %9.4f' %(rate, sigma_rate)


--- ctime 1990.0  m_c 4.0
--- ctime 1960.0  m_c 4.5
--- ctime 1910.0  m_c 5.5
B-value =    0.9654 +/-    0.0319
Rate (M >= 4.0) =    5.8212 +/-    0.1322

Recurrence Methods 2: Kijko & Smit (2012)

Implements the maximum likelihood estimator of Kijko & Smit (2012)


In [6]:
# Set up the configuration parameters
bks_recurrence = KijkoSmit()

bval, sigmab, rate, sigma_rate = bks_recurrence.calculate(catalogue, recurrence_config, completeness)

print 'B-value = %9.4f +/- %9.4f' % (bval, sigmab)
print 'Rate (M >= 4.0) = %9.4f +/- %9.4f' % (rate, sigma_rate)


B-value =    0.9462 +/-    0.0223
Rate (M >= 4.0) =    3.1935 +/-    0.0439

Recurrence Methods 3: Weichert (1980)

Implements the maximum likelihood estimator of Weichert (1980)


In [7]:
# Set up the configuration parameters
bwc_recurrence = Weichert()

bval, sigmab, rate, sigma_rate = bwc_recurrence.calculate(catalogue, recurrence_config, completeness)

print 'B-value = %9.4f +/- %9.4f' %(bval, sigmab)
print 'Rate (M >= 4.0) = %9.4f +/- %9.4f' %(rate, sigma_rate)


B-value =    0.9335 +/-    0.0172
Rate (M >= 4.0) =    5.4351 +/-    0.0101

In [ ]:

Maximum Magnitude Estimators

Kijko & Sellevol - Fixed b-value

Maximum likelihood estimator of maximum magnitude assuming no uncertainty in b-value (see Kijko (2004) for more details)


In [8]:
mmax_config = {'b-value': 1.0,
               'input_mmin': 4.5,
               'input_mmax': None,
               'input_mmax_uncertainty': None}

mmax_ks = KijkoSellevolFixedb()

mmax, mmax_sigma = mmax_ks.get_mmax(catalogue, mmax_config)

print 'Mmax = %8.3f +/- %8.3f' %(mmax, mmax_sigma)


4.5 7.4 1116.0 2.30258509299
Mmax =    7.749 +/-    0.363

Kijko & Sellevol - Uncertain b-value

Maximum likelihood estimator of maximum magnitude assuming uncertain b-value (see Kijko (2004) for more details)


In [9]:
mmax_config = {'b-value': 1.0,
               'sigma-b': 0.05,
               'input_mmin': 4.5,
               'input_mmax': None,
               'input_mmax_uncertainty': None}

mmax_ksb = KijkoSellevolBayes()

mmax, mmax_sigma = mmax_ksb.get_mmax(catalogue, mmax_config)

print 'Mmax = %8.3f +/- %8.3f' %(mmax, mmax_sigma)


Mmax =    7.732 +/-    0.347

Kijko & Sellevol Non-Parametric Gaussian

Maximum likelihood estimator of maximum magnitude assuming no specified magnitude frequency distribution (see Kijko (2004) for more details)


In [10]:
mmax_config = {'number_earthquakes': 100, # Selects the N largest earthquakes in the catalogue for analysis
               'input_mmax': None,
               'input_mmax_uncertainty': None}

mmax_knpg = KijkoNonParametricGaussian()
mmax, mmax_sigma = mmax_knpg.get_mmax(catalogue, mmax_config)
print 'Mmax = %8.3f +/- %8.3f' %(mmax, mmax_sigma)


Mmax =    7.543 +/-    0.175

Cumulative Moment Release (Adapted from Makropoulos & Burton (1983))

Estimator of Maximum Magnitude based on the "Cumulative Moment" method, an adaptation of the cumulative strain energy estimator of Mmax (Makropoulos & Burton, 1983), with Mmax uncertainty estimated via Monte Carlo sampling of the observed magnitude uncertainties


In [11]:
mmax_config = {'number_bootstraps': 1000} # Number of samples for the uncertainty analyis

mmax_cum_mo = CumulativeMoment()
mmax, mmax_sigma = mmax_cum_mo.get_mmax(catalogue, mmax_config)
print 'Mmax = %8.3f +/- %8.3f' %(mmax, mmax_sigma)


Mmax =    7.524 +/-    0.057